<?php
class Namemanager_Model_Namemanager implements Namemanager_Model_Mainable{
    
    private $core_controller_csrftoken;
    private $namemanager_data_getnamedata;
    private $namemanager_model_pagedecision;
    
    public function main(array $variables = null) {
        if(isset($variables['get']['page'])){
            $this->namemanager_model_pagedecision = new Namemanager_Model_Pagedecision;
            return $this->namemanager_model_pagedecision->main($variables);
        }
        else {
            $this->core_controller_csrftoken = new Core_Controller_Csrftoken;
            $this->namemanager_data_getnamedata = new Namemanager_Data_Getnamedata;
            $page['template'] = WEB_ROOT_FOLDER."namemanager/views/namemanager.php";
            $page['csrf_token'] = $this->core_controller_csrftoken->main($variables);
            $page['content'] = $this->namemanager_data_getnamedata->main($variables);
            return $page;
        }
    }

}
